<template>
   <div>
       <!-- 三级联动组件(全局组件，因此不需要引入) -->
       <TypeNav></TypeNav>
       <ListContainer></ListContainer>
       <Recommend></Recommend>
       <Rank></Rank>
       <Floor v-for="(floor,index) in floorList" :key="floor.id" :list="floor"/>
   </div>
</template> 
 
<script>
import ListContainer from './ListContainer.vue';
import Recommend from './Recommend.vue';
import Rank from './Rank.vue';
import Floor from './Floor.vue';
import {mapState} from 'vuex'
export default {
  name:'Home',
  components:{
      ListContainer,
      Recommend,
      Rank,
      Floor
   },
   async mounted(){
      //获取floor组件数据
      this.$store.dispatch('home/getFloorList')
      try {
         //获取用户信息
         await this.$store.dispatch('user/getUserInfo');
      } catch (error) {
         // console.log("未携带token！");
      }
   },
   computed:{
      ...mapState('home',['floorList'])
   }
}
</script>

<style>

</style>